Many computer systems provide a window-based user interface through which a user can interface with a computer program. A window is an area, typically rectangular, of a display device in which the computer program displays its output. A window may contain several different types of "fields" into which the computer program can display data. For example, in one field the computer program can display a label to be viewed by a user, and in another field the computer program can echo the characters entered by a user with a keyboard. Each of these fields are typically implemented as a child window of the window in which they are contained. These child windows are also known as "controls."
FIG. 1a illustrates a window that contains controls. Because this window contains information relating to properties of a document, it is known as a property sheet. A property specifies certain characteristics of an object, such as a document For example, the properties of a document may include name of the author and date of creation, whereas the properties of a character may include font and color. The property sheet 101 contains five property pages: general 102, summary 103, statistics 104, contents 105, and custom 106. Each property page is a child window of the property sheet and contains various controls, which are child windows of the property page. For example, the custom property page contains combobox 107, edit box 108, check box 109.
Certain windowing environments, such as Windows.RTM. by Microsoft Corporation, provide various tools to help a programmer generate programs that use windows and controls. In particular, to create a property page, such as the custom property page, a programmer uses a resource editor to define the layout and characteristics of the property page. These characteristics are stored in a resource file, which is opened and used by the computer program. Table 1 contains an excerpt of a resource file corresponding to the custom property page. This portion of the resource file contains the definition of the combobox 107, the edit box 108, the check box 109, and their associated labels. Each line contains the definition of a control. Line 1 corresponds to the label "Type:" to the left of combobox 107 and indicates that the control is a text control (i.e., "LTEXT") and that the control is static and located at the specified location. The location represented by "[location]" in each line indicates the upper left coordinates and the lower right coordinates of the location of the control within the custom property page. Line 2 corresponds to the combobox 107, indicates that the control is a combobox (i.e., "COMBOBOX"), and contains a unique identifier for the combobox (i.e., "IDC_COMBO1"). Line 2 also indicates that the combobox has a drop down list and that when a user tabs through the controls, the tab will stop at this combobox. Line 3 corresponds to the label "Value:" and indicates that the control is a text control and is static. Line 4 corresponds to the edit box 108, indicates that the control is an edit box (i.e., "EDITTEXT"), and contains a unique identifier for the control. Line 4 also indicates that the control will scroll horizontally and that the tab will stop at this control. Line 5 corresponds to the check box 108, indicates that the control is a control (i.e., "CONTROL"), and contains a unique identifier for the control. Line 5 also contains a label for the control (i.e., "Link To Content") and indicates that the control is a check box and that the tab will stop at this control.
TABLE 1 BEGIN . . . 1 LTEXT "Type:", IDC_STATIC, [location] 2 COMBOBOX IDC_COMBO1, [location], CBS_DROPDOWNLIST, WS_TABSTOP 3 LTEXT "Value:",IDC_STATIC, [location], 4 EDITTEXT IDC_EDIT1, [location], ES_AUTOHSCROLL, WS_TABSTOP 5 CONTROL "Link To Content", IDC_CHECK1, "Button", [location] . BS_AUTOCHECKBOX, WS_TABSTOP . . END
The use of resource files allows for various changes to be made to the arrangement and content of the controls without the need to modify the computer program that displays the controls. For example, the controls corresponding to the labels of the various boxes can be changed by simply modifying the resource file. The computer program would then be re-built (but not re-compiled). The next time the re-built computer program is executed, the program will open the resource file with the modifications and will display the modified controls.
FIGS. 1b-1d illustrate the operation of various types of controls. FIG. 1b illustrates the operation of a combobox. The combobox 107 comprises an edit box 107a and a list box 107b. When the user selects the arrow to the right of the edit box 107a, the list box 107b is displayed. The list box contains a list of the possible values that can be entered into the edit box 107a. A user can select one of the possible values from the list box 107b by selecting a value with a mouse and mouse pointer or can use the keyboard to enter a value directly into the edit box 107a. FIG. 1c illustrates the operation of an edit box. The user can type in any information into an edit box, subject to editing performed by the underlying computer program. FIG. 1d illustrates the operation of a check box. The check box 109 can be checked or unchecked by a user using a mouse and mouse pointer.
Typical computer programs allow for persistent storage of data entered into the various controls of a property page. Such data is typically persistently stored in a file on disk. Each computer program controls the retrieving of the values from the various controls and the storing of the values within the file. Thus, each developer of a computer program that persistently stores the values of the controls needs to develop code that implements such storing.
Typical computer programs use hard-coded values (i.e., defined in the source code) for the various list boxes, including for the list box of a combobox. Thus, to change the content of a list box, a developer would change and recompile the source code. Such changes of the source code are error prone and costly.